<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Title</title>
  </head>
  
  <body>
    <input type="button" value="发送请求" onclick="sendReq()">
  </body>
  
  <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.5.0/axios.js"></script>
  <script>
    function sendReq() {
      const requestInterceptors1 = axios.interceptors.request.use(
        (request) => {
          console.log('正常请求拦截器1');
          return request;
        },
      );
      const requestInterceptors2 = axios.interceptors.request.use(
        (request) => {
          console.log('正常请求拦截器1');
          return request;
        },
      );
      const responseInterceptors = axios.interceptors.response.use(
        (response) => {
          console.log('正常响应拦截器');
          return response;
        },
      );
      
      // 删除某个拦截器;
      axios.interceptors.request.eject(requestInterceptors1);
      
      // 删除所有请求拦截器
      axios.interceptors.request.clear();
      
      // 删除所有响应拦截器
      axios.interceptors.response.clear();
      
      axios.get('http://localhost:9000/back_end_get/params?query_name=query').then(res => {
        console.log('正常响应');
      }).catch(err => {
        console.error('错误响应');
      });
      
      // 输出结果：正常响应
    }
  </script>
</html>